<template>
  <lb-table
    ref="lbTable"
    border
    highlight-current-row
    element-loading-text="加载中"
    :column="tableData.column"
    :data="tableData.data"
    :pagination="false"
  />
</template>

<script>
  import { customerBottle } from '@/api'
  export default {
    name: 'tab-bottle',
    props: ['csmId'],
    data() {
      return {
        tableData: {
          column: [
            {
              prop: 'csmAddress',
              label: '租瓶地址'
            },
            {
              prop: 'goodsDesc',
              label: '规格型号'
            },
            {
              prop: 'totalCount',
              label: '数量'
            },
            {
              prop: 'totalDeposit',
              label: '押金'
            },
            {
              prop: 'totalRental',
              label: '租金'
            }
          ],
          data: []
        }
      }
    },
    created() {
      this.getData()
    },
    methods: {
      async getData() {
        // const params = {}
        const res = await customerBottle({ csmId: this.csmId })
        this.tableData.data = res.data.rows
        this.tableData.data.push(res.data.footer[0])
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>
